package entity

import org.codehaus.groovy.grails.web.taglib.jsp.JspDatePickerTag

import java.text.SimpleDateFormat

class Person {
    String name
    int age

    Date date;


    static constraints = {
        name blank: false, unique: true, matches: /[a-z]{2,10}/
        age range: 18..70
    }
    static hasOne = [address: Address]


    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", date=" + date +
                ", version=" + version +
                ", address=" + address +
                '}';
    }
}
